* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f0f8e5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background-color: #4caf50;
    padding: 15px;
    border-radius: 8px;
    color: white;
}

.resources {
    display: flex;
    gap: 20px;
}

.resource {
    font-size: 18px;
    font-weight: bold;
}

.game-area {
    display: flex;
    gap: 20px;
}

.farm-area {
    flex: 1;
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.farm-plots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.farm-plot {
    height: 180px;
    border: 2px dashed #4caf50;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    background-color: #f9f9f9;
    padding: 10px;
}

.farm-plot:hover {
    background-color: #e8f5e9;
}

.farm-plot.selected {
    border: 2px solid #2196f3;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
}

.crop-img-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3px;
    height: 120px;
}

.farm-plot img {
    max-width: 110%;
    max-height: 120px;
    object-fit: contain;
}

.farm-plot .progress-bar {
    width: 90%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

.farm-plot .progress {
    height: 100%;
    background-color: #4caf50;
    width: 0;
    transition: width 0.5s;
}

.control-panel {
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shop, .actions, .market {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #4caf50;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.seed-items, .market-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.seed-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.seed-img-container, .action-img-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.seed-img-container img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
}

.action-buttons {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 15px;
}

.action-img-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    width: 70px;
    height: 70px;
}

.action-img-container img {
    width: 65px;
    height: 65px;
    object-fit: contain;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #4caf50;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 140px;
}

.buy-btn, .sell-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    background-color: #4caf50;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.action-btn:hover, .buy-btn:hover, .sell-btn:hover {
    background-color: #388e3c;
}

.action-btn:disabled {
    background-color: #a5d6a7;
    cursor: not-allowed;
}

.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 30px;
    background-color: rgba(76, 175, 80, 0.95);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    min-width: 200px;
    max-width: 80%;
    pointer-events: none;
}

.notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
    animation: notificationPop 0.3s ease forwards;
}

@keyframes notificationPop {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 添加半透明遮罩 */
.notification::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification.show::before {
    opacity: 1;
}

.market-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.market-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .game-area {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
    }
}

.top-actions {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.top-actions .action-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 30px;
}

.top-actions .action-btn {
    flex: 0 1 220px;
    min-height: 120px;
}

.top-actions .action-img-container {
    width: 100px;
    height: 100px;
}

.top-actions .action-img-container img {
    width: 95px;
    height: 95px;
}

.top-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.farm-operations {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 30px;
    flex: 1;
}

.divider {
    width: 2px;
    background-color: #e0e0e0;
    align-self: stretch;
    margin: 0 10px;
}

.top-market {
    flex: 1;
    max-width: 450px;
    border-left: 1px solid #e0e0e0;
    padding-left: 20px;
}

.top-market h3 {
    color: #4caf50;
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 5px;
}

.market-info {
    text-align: center;
    margin-bottom: 10px;
    color: #777;
    font-size: 14px;
}

.top-market-items {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    max-height: 150px;
    overflow-y: auto;
    padding: 5px;
}

.top-market-items .market-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
    width: calc(33.33% - 10px);
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid transparent;
}

.top-market-items .market-item:hover {
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.top-market-items .market-item:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.top-market-items .market-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 5px;
}

.top-market-items .market-item p {
    font-size: 12px;
    margin-bottom: 5px;
    text-align: center;
}

.top-market-items .market-item .price {
    color: #e91e63;
    font-weight: bold;
}

.top-market-items .market-item .sell-btn {
    display: none;
}

.empty-market {
    text-align: center;
    color: #999;
    padding: 20px 0;
    font-style: italic;
}

/* 对话气泡样式 */
.speech-bubble {
    position: absolute;
    top: -30px;
    background-color: white;
    border: 2px solid #4caf50;
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 12px;
    color: #333;
    z-index: 10;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.speech-bubble:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: #4caf50 transparent;
}

.speech-bubble.show {
    opacity: 1;
    transform: translateY(0);
}

/* 拖拽相关样式 */
.draggable {
    cursor: grab;
    transition: transform 0.2s;
}

.draggable:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.farm-plot.drag-over {
    background-color: #e8f5e9;
    border: 2px dashed #2196f3;
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.3);
}

.dragging {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    transform: translate(-50%, -50%);
    opacity: 0.8;
} 